<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.org/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Title</title>
    <link rel="stylesheet" href="/resources/layui/css/layui.css">
</head>
<body>
<script src="/resources/layui/layui.js"></script>

<script th:inline="none">
    //一般直接写在一个js文件中
    layui.use(['layer', 'form','table'], function(){
        var layer = layui.layer
            ,form = layui.form
            ,table = layui.table
            ,$=layui.jquery;
        $("#btn_add").click(function () {
            $.ajax({
                type:'post',
                url:'role/addUserOn',
                data:$("#supAddForm").serialize(),
                success:function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);//关闭当前页
                    //刷新父类页面
                    window.parent.location.reload()

                }
            })
        })
    });
</script>
<form class="layui-form" action="" id="supAddForm">
    <div class="layui-form-item">
        <label class="layui-form-label">电话</label>
        <div class="layui-input-block">
            <input type="text" name="name" required  lay-verify="required" placeholder="请输入角色" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <!--<button class="layui-btn" lay-submit lay-filter="formDemo" id="btn_add">立即提交</button>-->
            <input type="button" class="layui-btn" id="btn_add" value="立即提交">
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

</body>
</html>